<template>
    <!--  横幅  -->
    <div id="banner" ref="banner">
        <div class="left">
            <!-- 图标 注意assets图片的引用方式 -->
            <img id="logo" alt="" :src="getLogo"/>
            <el-tooltip class="item" effect="dark" content="点击跳转到首页" placement="bottom-end">
                <div id="title" @click="linkToIndex()">{{ titleStr }}</div>
            </el-tooltip>
        </div>
        <div class="right">
            <BannerNav></BannerNav>
        </div>
    </div>
</template>

<script>
import BannerNav from "@/components/web/header/BannerNav";

export default {
    name: "Banner",
    components: {
        BannerNav
    },
    computed: {
        getLogo() {
            return require('@/assets/catLogo.jpeg');
        }
    },
    data() {
        return {
            // logoSrc: require('@/assets/catLogo.jpeg'),
            titleStr: "方糖的小屋"
        }
    },
    methods: {
        linkToIndex() {
            this.$router.push("/")
        }
    }
}
</script>

<style scoped>

/* 头部 */
#banner {
    height: 100%;
    color: #FFFFFF;
    /* background-color: #666699; */
    background-color: rgb(204, 200, 200);
    /* border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px; */
    box-shadow: 0 1px 35px 1px black;
    user-select: none;
}

#banner .left {
    width: auto;
    height: 100%;
    float: left;
}

/* 头部logo */
#banner #logo {
    float: left;
    height: 100%;
    margin-left: 40px;
    background-color: rgb(204, 200, 200);
}

/* 班级名称 */
#banner #title {
    float: left;
    height: 100%;
    font-size: 50px;
    font-family: 'whiteStyle', serif;
    font-weight: bolder;
    line-height: 50px;
    margin-left: 30px;
    color: black;
    cursor: pointer;
}

/* 右侧导航栏 */
.right {
    float: right;
    width: auto;
    height: 100%;
}

</style>
